package com.example.gokuplayalong.bases.network.security;


import com.example.gokuplayalong.BuildConfig;
import com.example.gokuplayalong.MainActivity;
import com.example.gokuplayalong.R;

public class Keys {

    private static Keys INSTANCE = null;

    public static Keys getInstance() {
        if (INSTANCE == null) INSTANCE = new Keys();
        return INSTANCE;
    }

    public String getKey() {
        return getKy1() + getKy2() + getKy3() + getKy4();
    }

    protected String getKy1() {
        return BuildConfig.appKey;
    }

    protected String getKy2() {
        return getKeyK();
    }

    protected String getKy3() {
        return "ODZaUP9k/fjIDxG5BRN82HI+57VLtyNdQT0G0Zr1tIAatkH6BKTVg9h4Wwaz6zQRZ5o/kngrhb2TuXzZRowGkBlA0BSddfsqHQknGBtscHYIv36OImD+UoZrLa9qGs93c8Z7mTBreeJYnv3ZJwx4/DedvPlVDp5kstmR7Ap1WgbVYO0FvJWbnHl9glP";
    }

    protected String getKy4() {
        return MainActivity.getInstance().getString(R.string.bk4);
    }

    protected String getKeyK() {

        int[] ks = {41, 69, 56, 69, 50, 67, 57, 49, 32, 64, 33, 3, 58, 17, 9, 69, 72, 3, 29, 61, 7, 35, 57, 61, 49, 69, 5, 71, 54, 49, 1, 53, 68, 51, 34, 37, 27, 23, 6, 55, 18, 17, 2, 23, 63, 52, 34, 42, 3, 23, 21, 71, 2, 40, 63, 67, 17};
        byte[] bs = new byte[ks.length];
        for (int i = 0; i < ks.length; i++) {
            bs[i] = (byte) (ks[i] + '0');
        }
        return new String(bs);
    }
}
